package com.eelye.util.winui.window;

import com.eelye.util.winui.manager.ProcessManager;
import com.eelye.util.winui.manager.WindowManager;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertNotNull;

class TreeViewTest_UT {

    @Nested
    class selectMenu {

        @Test
        void 测试点击根菜单_生效() throws Exception {
            Process p = ProcessManager.launchProcess("C:\\Windows\\explorer.exe");

            String clsName = "CabinetWClass";
            String text = "文件资源管理器";
            Window top = WindowManager.findTopWindow(clsName, true, text, true, 5_000);
            assertNotNull(top);

            int id = 0x064;
            TreeView treeView = (TreeView) top.findChild(id, "SysTreeView32", true, 500);
            treeView.getChild(null);

            p.terminate();
        }

    }
}